import {getToken} from "../utils/authority";
import {stringify} from 'qs';
import request from '../utils/request';

export async function queryPerson(params) {
  return request(`/labor/person/page?${stringify(params)}`,{
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${getToken()}`,
    },
  });
}

export async function getPerson(params) {
  return request('/labor/person/' + params, {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${getToken()}`,
    },
  });
}

export async function addPerson(params) {
  return request('/labor/person/', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${getToken()}`,
    },
    body: params,
  });
}

export async function delPerson(params) {
  return request('/labor/person/' + params, {
    method: 'DELETE',
    headers: {
      'Authorization': `Bearer ${getToken()}`,
    },
  })
}

export async function putPerson(params) {
  return request(
    '/labor/person/', {
      method: 'PUT',
      headers: {
        'Authorization': `Bearer ${getToken()}`,
      },
      body: params,
    })
}

addPerson

